package com.cremamobile.filemanager;

import android.app.Dialog;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;

public class CremaProgressDialog extends Dialog {
	TextView contentText;
	TextView contentSizeText;
	ProgressBar progressBar;
	
	Context context;
	public CremaProgressDialog(Context context) {
		super(context, android.R.style.Theme_Translucent_NoTitleBar);
		this.context = context;
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setCancelable(false);
		setContentView(R.layout.progress_dialog);
		
        Button closeButton = (Button) findViewById(R.id.button_close);
        closeButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				int id = v.getId();
				if (id == R.id.button_close) {
					dismiss();
				}
			}
        });
        
        contentText = (TextView) findViewById(R.id.content_message);
        contentSizeText = (TextView) findViewById(R.id.content_size);
        progressBar = (ProgressBar) findViewById(R.id.progressbar);
	}
	
    
	public void setMax(int max) {
		progressBar.setMax(max);
	}
	
	public void setProgress(int step) {
		progressBar.setProgress(step);
	}
	
	public void setContentText(String text) {
		contentText.setText(text);
	}
	
	public void setContentSizeText(String text) {
		contentSizeText.setText(text);
	}
	
}